package a.f.g;

import a.c.bb;
import a.c.e;
import a.f.o;
import a.f.zc;

import java.awt.geom.PathIterator;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.List;

public class g
  extends a.f.c.k
{
  public static final Object n = "y.layout.organic.EllipticalGroupBoundsCalculator#SHAPE_POINT_PROVIDER_DPKEY";
  public static boolean o;
  
  public Rectangle2D a(o paramo, e parame, bb parambb)
  {
    boolean bool = j.c;
    int j = j.b;
    a.c.k localk = paramo.c(n);
    Rectangle2D localRectangle2D = super.a(paramo, parame, parambb);
    Ellipse2D.Double localDouble = new Ellipse2D.Double(localRectangle2D.getCenterX(), localRectangle2D.getCenterY(), 1.0D, 1.0D);
    a.c.w localw = parambb.l();
    if (localw.e()) {
      if ((!bool) && (localk == null)) {}
    }
    label346:
    label348:
    label352:
    while (bool)
    {
      Object localObject = (b_)localk.get(localw.d());
      List localList;
      int i;
      if ((bool) || (localObject != null))
      {
        localList = ((b_)localObject).a(paramo, localw.d());
        if (((bool) || (localList != null)) && ((bool) || (!localList.isEmpty()))) {
          i = 0;
        }
      }
      while (i < localList.size())
      {
        a.d.w localw1 = (a.d.w)localList.get(i);
        a(localDouble, localw1.a, localw1.b);
        i++;
        if (bool) {
          break label348;
        }
        if (j != 0) {
          break label346;
        }
        if (j != 0)
        {
          localObject = paramo.d(localw.d());
          a(localDouble, ((zc)localObject).a(), ((zc)localObject).b());
          a(localDouble, ((zc)localObject).a() + ((zc)localObject).c(), ((zc)localObject).b());
          a(localDouble, ((zc)localObject).a(), ((zc)localObject).b() + ((zc)localObject).d());
          if (bool) {
            break label352;
          }
          a(localDouble, ((zc)localObject).a() + ((zc)localObject).c(), ((zc)localObject).b() + ((zc)localObject).d());
        }
      }
      localw.f();
      if (j == 0) {
        break;
      }
    }
    return a(paramo, parame, parambb, localDouble.getBounds2D());
  }
  
  void a(Ellipse2D.Double paramDouble, double paramDouble1, double paramDouble2)
  {
    if ((j.c) || (!paramDouble.contains(paramDouble1, paramDouble2)))
    {
      double d1 = paramDouble.getWidth() / 2.0D;
      double d2 = paramDouble.getHeight() / 2.0D;
      double d3 = paramDouble.getCenterX();
      double d4 = paramDouble.getCenterY();
      double d5 = (paramDouble1 - d3) / d1;
      double d6 = (paramDouble2 - d4) / d2;
      double d7 = Math.sqrt(d5 * d5 + d6 * d6);
      d5 *= d1 / d7;
      d6 *= d2 / d7;
      double d8 = ((paramDouble1 - d3) / d5 - 1.0D) * d1;
      double d9 = ((paramDouble2 - d4) / d6 - 1.0D) * d2;
      paramDouble.setFrame(paramDouble.getX() - d8, paramDouble.getY() - d9, paramDouble.getWidth() + 2.0D * d8, paramDouble.getHeight() + 2.0D * d9);
    }
  }
  
  public static final class a_
    implements g.b_
  {
    public static boolean a;
    
    public List a(o paramo, e parame)
    {
      boolean bool = j.c;
      int j = j.b;
      zc localzc = paramo.d(parame);
      Ellipse2D.Double localDouble = new Ellipse2D.Double(localzc.a() - 3.0D, localzc.b() - 3.0D, localzc.c() + 6.0D, localzc.d() + 6.0D);
      PathIterator localPathIterator = localDouble.getPathIterator(null, 3.0D);
      ArrayList localArrayList = new ArrayList(32);
      double[] arrayOfDouble = new double[6];
      do
      {
        if (localPathIterator.isDone()) {
          break;
        }
        int i = localPathIterator.currentSegment(arrayOfDouble);
        if (!bool)
        {
          switch (i)
          {
          case 0: 
            localArrayList.add(new a.d.w(arrayOfDouble[0], arrayOfDouble[1]));
            if (bool) {
              continue;
            }
            if (j == 0) {
              break;
            }
          case 1: 
            localArrayList.add(new a.d.w(arrayOfDouble[0], arrayOfDouble[1]));
            break;
          }
          localPathIterator.next();
        }
      } while (j == 0);
      return localArrayList;
    }
  }
  
  public static abstract interface b_
  {
    public abstract List a(o paramo, e parame);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.g.g

 * JD-Core Version:    0.7.0.1

 */